package cz.none.bezbarier.web.util;

public class Constants {
	private Constants() {
	}

	public class Common {

		private Common() {
		}

		public static final int PAGE_SIZE = 4; // 20;
		public static final int PAGINATOR_SIZE = 5;

		public static final String SALT = "some-Strong-Salt-12345.,";
	}

	public class Form {
		private Form() {
		}

		public static final String SUBMIT = "submit";
	}

	public class Menu {
		private Menu() {
		}

		public static final String HOME = "home";
		public static final String MAP = "map";
		public static final String CATALOG = "catalog";
		public static final String LOGIN = "login";
	}

	public class Page {
		private Page() {
		}

		// Mappings
		public static final String HOME_M = "/";
		public static final String ADMIN_M = "/admin";
		public static final String LOGIN_M = "/login";
		public static final String DENIED_M = "/denied";
		public static final String USER_LIST_M = "/user/list";
		public static final String USER_ADD_M = "/user/add";
		public static final String USER_EDIT_M = "/user/edit/{userId}";
		public static final String USER_DEL_M = "/user/del/{userId}";
		public static final String USER_PROFILE_M = "/profile/{userId}";
		public static final String MAP_M = "/map";
		public static final String CATALOG_M = "/catalog";
		public static final String CATALOG_EDIT_M = "/edit";
		public static final String CATALOG_EDIT_EXIST_M = "/edit/{placeId}";
		public static final String CATALOG_PLACE_M = "/place/{placeId}";

		// Views
		public static final String HOME = "home/home";
		public static final String LOGIN = "security/login";
		public static final String DENIED = "security/denied";
		public static final String USER_LIST = "user/list";
		public static final String USER_FORM = "user/form";
		public static final String USER_EDIT_FORM = "user/edit";
		public static final String USER_PROFILE = "user/profile";
		public static final String MAP = "place/map";
		public static final String CATALOG_BROWSE = "catalog/browse";
		public static final String CATALOG_FORM = "catalog/form";
		public static final String CATALOG_SHOW = "catalog/show";
	}

	public class SQL {
		private SQL() {
		}

		private static final String PLACE_TYPE = "FROM cz.none.bezbarier.web.model.Place p WHERE type = ?1";
		public static final String PLACE_TYPE_COUNT = "SELECT COUNT(p) " + PLACE_TYPE;
		public static final String PLACE_TYPE_SELECT = "SELECT p " + PLACE_TYPE;

		private static final String PLACE_NAME = "FROM cz.none.bezbarier.web.model.Place p WHERE name >= ?1 AND name < ?2";
		public static final String PLACE_NAME_SELECT = "SELECT p " + PLACE_NAME;
		public static final String PLACE_NAME_COUNT = "SELECT COUNT(p) " + PLACE_NAME;

		private static final String PLACE_TYPE_NAME = "FROM cz.none.bezbarier.web.model.Place p WHERE (type = ?1 AND name >= ?2 AND name < ?3)";
		public static final String PLACE_TYPE_NAME_SELECT = "SELECT p " + PLACE_TYPE_NAME;
		public static final String PLACE_TYPE_NAME_COUNT = "SELECT COUNT(p) " + PLACE_TYPE_NAME;
	}
}
